#!/usr/bin/env python
#-*- coding:utf-8 -*-
# author:Vergil
# datetime:2018/11/17 22:58
# software: PyCharm
from django.contrib.auth.forms import UserCreationForm
from django import forms
from .models import User

class RegisterForm(forms.Form):
    stu_id = forms.CharField(label='学号', max_length=8)
    password = forms.CharField(label='密码', widget=forms.PasswordInput())
    password_again = forms.CharField(label='确认密码', widget=forms.PasswordInput())
    email = forms.EmailField(label='电子邮箱')
    address = forms.CharField(label='寝室号',max_length=20)


class LoginForm(forms.Form):
    stu_id = forms.CharField(label='学号', max_length=8)
    password = forms.CharField(label='密码', widget=forms.PasswordInput())

class UpdateForm(forms.Form):
    class Meta:
        model = User
        fields = ('password', 'address', 'email', 'nick_name')